CMake: Explicitly state which files to compile instead of relying on globbing.

Also remove header file lists, as there is no need to add them to
add_library() or add_executable(), which should lower maintenance of the cmake files.
This commit is contained in:
Christian Parpart
2018-11-26 14:39:24 +01:00
parent 96333f3033
commit cdd8c72c9d
5 changed files with 100 additions and 17 deletions
+13 -3
View File
@@ -1,7 +1,17 @@
file(GLOB sources "*.cpp")
file(GLOB headers "*.h")
set(sources
CommonData.cpp
CommonIO.cpp
Exceptions.cpp
IndentedWriter.cpp
JSON.cpp
Keccak256.cpp
StringUtils.cpp
SwarmHash.cpp
UTF8.cpp
Whiskers.cpp
)
add_library(devcore ${sources} ${headers})
add_library(devcore ${sources})
target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Boost_REGEX_LIBRARIES} ${Boost_SYSTEM_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}")
target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})