Skip to content

Commit f39d994

Browse files
committedNov 3, 2022
improved dependency library management
with FIND_PACKAGE and CMake variables added some quotation marks for MSVS
1 parent 52e7e60 commit f39d994

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed
 

‎Examples/CommandString/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ SET(CommandStringSources
2323
)
2424

2525
IF(MSVC)
26-
ADD_DEFINITIONS(-DBRLCAD_MOOSE_EXPORT=__declspec(dllimport))
26+
ADD_DEFINITIONS("-DBRLCAD_MOOSE_EXPORT=__declspec(dllimport)")
2727
ELSE(MSVC)
28-
ADD_DEFINITIONS(-DBRLCAD_MOOSE_EXPORT=)
28+
ADD_DEFINITIONS("-DBRLCAD_MOOSE_EXPORT=")
2929
ENDIF(MSVC)
3030

3131
ADD_EXECUTABLE(CommandString ${CommandStringSources})
32-
TARGET_LINK_LIBRARIES(CommandString ${BRLCAD_MOOSE_LIBRARY} pthread)
32+
TARGET_LINK_LIBRARIES(CommandString ${BRLCAD_MOOSE_LIBRARY})
3333
SET_TARGET_PROPERTIES(CommandString PROPERTIES OUTPUT_NAME "printtitle_commandstring")

‎Examples/Database/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ SET(DatabaseSources
2323
)
2424

2525
IF(MSVC)
26-
ADD_DEFINITIONS(-DBRLCAD_MOOSE_EXPORT=__declspec(dllimport))
26+
ADD_DEFINITIONS("-DBRLCAD_MOOSE_EXPORT=__declspec(dllimport)")
2727
ELSE(MSVC)
28-
ADD_DEFINITIONS(-DBRLCAD_MOOSE_EXPORT=)
28+
ADD_DEFINITIONS("-DBRLCAD_MOOSE_EXPORT=")
2929
ENDIF(MSVC)
3030

3131
ADD_EXECUTABLE(Database ${DatabaseSources})
32-
TARGET_LINK_LIBRARIES(Database ${BRLCAD_MOOSE_LIBRARY} pthread)
32+
TARGET_LINK_LIBRARIES(Database ${BRLCAD_MOOSE_LIBRARY})
3333
SET_TARGET_PROPERTIES(Database PROPERTIES OUTPUT_NAME "printtitle_database")

‎src/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ SET(DatabaseSources "")
3535
ADD_SUBDIRECTORY(Database)
3636
GET_DIRECTORY_PROPERTY(DatabaseSources DIRECTORY Database DEFINITION DatabaseSources)
3737

38+
FIND_PACKAGE(Threads)
39+
3840
# Module: Command string
3941
SET(CommandStringSources "")
4042
OPTION(MODULE_COMMANDSTRING "Build the command string module" OFF)
@@ -107,6 +109,8 @@ TARGET_LINK_LIBRARIES(brlcad
107109
${MSVC_LIBRARIES}
108110
uuid
109111
${LUA_LIBRARIES}
112+
${CMAKE_DL_LIBS}
113+
Threads::Threads
110114
)
111115

112116
INSTALL(TARGETS brlcad DESTINATION lib)

0 commit comments

Comments
 (0)
Please sign in to comment.