Skip to content

Commit 3ae5290

Browse files
committed
cmake: set shared libs before extern inclusion
1 parent df5ed45 commit 3ae5290

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

CMakeLists.txt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ if(NOT WITH_INET)
5454
endif()
5555
endif()
5656

57+
##############################
58+
# Artery build configuration #
59+
##############################
60+
61+
# use "RelWithDebInfo" as default build type
62+
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
63+
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "CMake build type" FORCE)
64+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
65+
endif()
66+
67+
# running simulations with opp_run requires shared libraries
68+
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "Cached for propagation to sub-projects with older CMake versions")
69+
5770
###############################
5871
# Required packages & scripts #
5972
###############################
@@ -106,18 +119,9 @@ macro(add_artery_feature name)
106119
install(TARGETS ${name} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
107120
endmacro()
108121

109-
##############################
110-
# Artery build configuration #
111-
##############################
112-
113-
# use "RelWithDebInfo" as default build type
114-
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
115-
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "CMake build type" FORCE)
116-
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
117-
endif()
118-
119-
# running simulations with opp_run requires shared libraries
120-
set(BUILD_SHARED_LIBS ON CACHE INTERNAL "Cached for propagation to sub-projects with older CMake versions")
122+
##########
123+
# Artery #
124+
##########
121125

122126
add_subdirectory(src/traci)
123127
add_subdirectory(src/artery)

0 commit comments

Comments
 (0)