Skip to content

Commit 0995062

Browse files
committed
Revert "Revert "CMake: workaround for CMake-Mac OS X fail""
Tests have shown this to work, and the simpler method not :/ Thanks to pepijn for testing This reverts commit 10d1f64.
1 parent 8f1f25e commit 0995062

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

AI/Interfaces/C/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ macro (ConfigureNativeSkirmishAI mySourceDirRel_var additionalSources_var add
4646

4747
# Compile the library
4848
add_library(${myTarget} MODULE ${mySources} ${additionalSources})
49+
FixLibName(${myTarget})
50+
4951
target_link_libraries(${myTarget} ${additionalLibraries})
5052
set_target_properties(${myTarget} PROPERTIES COMPILE_FLAGS "${additionalCompileFlags}")
5153
set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "SkirmishAI")
@@ -99,6 +101,8 @@ if (BUILD_${myName}_AIINTERFACE)
99101

100102
aux_source_directory(${mySourceDir} mySources)
101103
add_library(${myTarget} MODULE ${mySources} ${ai_common_SRC} ${CUtils_SRC})
104+
FixLibName(${myTarget})
105+
102106
set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "AIInterface")
103107

104108
# Install the data files

AI/Interfaces/Java/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ if (BUILD_${myName}_AIINTERFACE)
327327
endif (MINGW)
328328
include_directories(BEFORE ${rts}/lib/streflop)
329329
add_library(${myTarget} MODULE ${myNativeSources} ${ai_common_SRC} ${CUtils_SRC})
330+
FixLibName(${myTarget})
330331
target_link_libraries(${myTarget} streflop)
331332
set_target_properties(${myTarget} PROPERTIES COMPILE_FLAGS "-DUSING_STREFLOP")
332333
set_target_properties(${myTarget} PROPERTIES OUTPUT_NAME "AIInterface")

CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
cmake_minimum_required(VERSION 2.6)
33
project(Spring)
44

5+
# This is needed, as CMake, or at least soem versions of it (eg. 2.8),
6+
# falsely use the ".so" suffix unde Mac OS X for MODULE's
7+
macro (FixLibName targetName)
8+
IF (UNIX)
9+
SET_TARGET_PROPERTIES(${targetName} PROPERTIES PREFIX "lib")
10+
IF (APPLE)
11+
SET_TARGET_PROPERTIES(${targetName} PROPERTIES SUFFIX ".dylib")
12+
ENDIF (APPLE)
13+
ENDIF (UNIX)
14+
endmacro (FixLibName targetName)
15+
516
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/rts/build/cmake")
617

718
### Install path (relative to CMAKE_INSTALL_PREFIX)

0 commit comments

Comments
 (0)