Browse Source

replace add_definitions call with target_compile_definitions

alex 2 years ago
parent
commit
726bb19475
1 changed files with 7 additions and 1 deletions
  1. 7 1
      CMakeLists.txt

+ 7 - 1
CMakeLists.txt

@@ -1,6 +1,12 @@
 cmake_minimum_required(VERSION 3.0)
 project(enet C)
 
+# defaults
+set(ENET_STATIC ON)
+set(ENET_SHARED OFF)
+set(ENET_TEST OFF)
+
+# configure projects
 if (ENET_STATIC)
     add_library(enet STATIC test/library.c)
 
@@ -10,7 +16,7 @@ if (ENET_STATIC)
 endif()
 
 if (ENET_SHARED)
-    add_definitions(-DENET_DLL)
+    target_compile_definitions(enet PUBLIC -DENET_DLL)
     add_library(enet SHARED test/library.c)
 
     if (WIN32)